<?php

namespace App\Admin\Controllers;

use App\Models\Product;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Layout\Content;


class Test extends AdminController
{


    public function index(Content $content)
    {

//        $model =  new Product([
////            'id' => uniqid(),
//            'name' => 'sku111',
//            'color' => 'red',
//        ]);
//
//        $model->save();

        $model = Product::get();  //mongodb

        $content->title('测试页面');

        $body = $model->toJson();

        return $content->body($body);
    }



}
